﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Magic.Web.Entry;

/// <summary>
/// 验证码服务
/// </summary>
public class ClickCaptchaController : BaseController
{
    private readonly IClickCaptchaService _service;
    public ClickCaptchaController(IClickCaptchaService service)
    {

        _service = service;

    }

    [HttpGet("clickCaptcha")]
    [AllowAnonymous]
    public async Task<ClickCaptchaOutput> GetClickCaptcha([FromQuery]ClickCaptchaInput input) { 
        return await _service.ClickCaptcha(input);
    }

    [HttpPost("checkClickCaptcha")]
    [AllowAnonymous]
    public async Task ClickCaptcha(CheckClickCaptchaInput input)
    {
         await _service.CheckClickCaptcha(input);
    }


}
